<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title></title>
	</head>
	<body>
		<input type="button" class="haha" id="btn" value="你好" />
		<input type="button" class="haha"  value="hello" />
	</body>
	<script type="text/javascript">
		
//		var btn = document.getElementById("btn");
//		var btn = document.getElementsByClassName("haha");
//		var btn = document.getElementsByTagName("input");
		var btn = document.querySelector("#btn");
		
		console.log(btn)
		var x = 0;
		btn.onclick = function(){
			btn.style.backgroundColor = "green";
			btn.value = ++x;
		}
	</script>
</html>
